home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / programer2 / sdls / DLLLib_h_errno < prev    next >
Encoding:
Text File  |  1994-03-05  |  2.3 KB  |  73 lines

  1. #pragma force_top_level
  2. #pragma include_only_once
  3.  
  4. /* errno.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.1.3 */
  5. /* Copyright (C) Codemist Ltd. */
  6. /* Copyright (C) Acorn Computers Ltd. 1991, 1992 */
  7. /* version 2.00 */
  8.  
  9. #ifndef __errno_h
  10. #define __errno_h
  11.  
  12. #ifndef errno
  13.   #ifdef __cplusplus
  14.     extern "C" {
  15.     #define _VOLATILE
  16.   #else
  17.     #define _VOLATILE volatile
  18.   #endif
  19.  
  20.   #ifdef SYSTEM_STATICS
  21.     extern _VOLATILE int *__errno;
  22.     #define errno *__errno
  23.   #elif defined(_DLL)
  24.     extern int *_dll_errno(void);
  25.     #define errno (*_dll_errno())
  26.   #else
  27.     extern _VOLATILE int __errno;
  28.     #define errno __errno
  29.   #endif
  30.  
  31.   #ifdef __cplusplus
  32.     }
  33.   #endif
  34.  
  35.   #undef _VOLATILE
  36.  
  37. #endif
  38.  
  39.    /*
  40.     * expands to a modifiable lvalue that has type volatile int, the value of
  41.     * which is set to a positive error code by several library functions. It is
  42.     * initialised to zero at program startup, but is never set to zero by any
  43.     * library function. The value of errno may be set to nonzero by a library
  44.     * function call whether or not there is an error, provided the use of errno
  45.     * is not documented in the description of the function in the Standard.
  46.     */
  47.  
  48. #define EDOM    1
  49.    /*
  50.     * if a domain error occurs (an input argument is outside the domain over
  51.     * which the mathematical function is defined) the integer expression errno
  52.     * acquires the value of the macro EDOM and HUGE_VAL is returned. EDOM may
  53.     * be used by non-mathematical functions.
  54.     */
  55. #define ERANGE 2
  56.    /*
  57.     * a range error occurs if the result of a function can not be represented
  58.     * as a double value. If the result overflows (the magnitude of the result
  59.     * is so large that it cannot be represented in an object of the specified
  60.     * type), the function returns the value of the macro HUGE_VAL, with the
  61.     * same sign as the correct value of the function; the integer expression
  62.     * errno acquires the value of the macro ERANGE. If the result underflows
  63.     * (the magnitude of the result is so small that it cannot be represented
  64.     * in an object of the specified type), the function returns zero; the
  65.     * integer expression errno acquires the value of the macro ERANGE. ERANGE
  66.     * may be used by non-mathematical functions.
  67.     */
  68. #define ESIGNUM 3
  69.  
  70. #endif
  71.  
  72. /* end of errno.h */
  73.